package aufgaben;

public class Zahlen{
  public static void main(String[] args){
    //double z=Double.parseDouble(args[0]);
    //System.out.println(heron(z));
    int t=Integer.parseInt(args[0]);
    int m=Integer.parseInt(args[1]);
    int j=Integer.parseInt(args[2]);
    System.out.println(wota(t, m, j));
  }

  public static double heron(double a){
    double x=1, y=a;
    while(Math.nextAfter(x, y)!=y){
      x=(x+y)/2;
      y=a/x;
    }
    return x;
  }

  private static final String[] N={"So","Mo","Di","Mi","Do","Fr","Sa"};
  public static String wota(int t, int m, int j){
    if(m<3) j--;
    int h=j/100;
    j%=100;
    m=1+(m+9)%12;
    return N[(t+(int)(2.6*m-0.2)+j+(int)(j/4)+(int)(h/4)+5*h)%7];
  }
}

